package com.link2room.aeriabots.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * Created by Administrator on 2017/3/20.
 */
@Entity
@Table(name = "web_prepay_log")
public class WebPrepayLogEntity extends BaseEntity{
    private String channel;
    private String outTradeNo;
    private String tradeNo;
    private String orderNo;
    private String resultCode;
    private String prepayId;
    private BigDecimal amount;
    private String notifyService;

    @Basic
    @Column(name = "channel")
    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    @Basic
    @Column(name = "out_trade_no")
    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    @Basic
    @Column(name = "trade_no")
    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    @Basic
    @Column(name = "order_no")
    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    @Basic
    @Column(name = "result_code")
    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    @Basic
    @Column(name = "prepay_id")
    public String getPrepayId() {
        return prepayId;
    }

    public void setPrepayId(String prepayId) {
        this.prepayId = prepayId;
    }
    @Basic
    @Column(name = "amount", nullable = true,  precision = 12,scale = 2)
    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }
    @Basic
    @Column(name = "notify_service")
    public String getNotifyService() {
        return notifyService;
    }

    public void setNotifyService(String notifyService) {
        this.notifyService = notifyService;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WebPrepayLogEntity that = (WebPrepayLogEntity) o;

        if (channel != null ? !channel.equals(that.channel) : that.channel != null) return false;
        if (outTradeNo != null ? !outTradeNo.equals(that.outTradeNo) : that.outTradeNo != null) return false;
        if (tradeNo != null ? !tradeNo.equals(that.tradeNo) : that.tradeNo != null) return false;
        if (orderNo != null ? !orderNo.equals(that.orderNo) : that.orderNo != null) return false;
        if (resultCode != null ? !resultCode.equals(that.resultCode) : that.resultCode != null) return false;
        if (prepayId != null ? !prepayId.equals(that.prepayId) : that.prepayId != null) return false;
        if (amount != null ? !amount.equals(that.amount) : that.amount != null) return false;
        if (notifyService != null ? !notifyService.equals(that.notifyService) : that.notifyService != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = channel != null ? channel.hashCode() : 0;
        result = 31 * result + (outTradeNo != null ? outTradeNo.hashCode() : 0);
        result = 31 * result + (tradeNo != null ? tradeNo.hashCode() : 0);
        result = 31 * result + (orderNo != null ? orderNo.hashCode() : 0);
        result = 31 * result + (resultCode != null ? resultCode.hashCode() : 0);
        result = 31 * result + (prepayId != null ? prepayId.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (notifyService != null ? notifyService.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "WebPrepayLogEntity{" +
                "channel='" + channel + '\'' +
                ", outTradeNo='" + outTradeNo + '\'' +
                ", tradeNo='" + tradeNo + '\'' +
                ", orderNo='" + orderNo + '\'' +
                ", resultCode='" + resultCode + '\'' +
                ", prepayId='" + prepayId + '\'' +
                ", amount=" + amount +
                ", notifyService='" + notifyService + '\'' +
                "} " + super.toString();
    }
}
